home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
Hamandel v1.0.adf
/
HAMandel.doc
< prev
next >
Wrap
Text File
|
1988-09-17
|
38KB
|
757 lines
COPYRIGHT 1988 BY DANIEL WOLF - ALL RIGHTS RESERVED
MegageM
Box 1785
Santa Maria, CA 93456
805 349 1104
July 23, 1988
HAMandel Documentation
***** What is HAMandel?
HAMandel is a fractal image generating program for all Amiga computers.
The remarkable features of HAMandel are a result of technology developments
by Daniel Wolf Ph.D. which, for the first time, utilize the HAM graphics
mode of the Amiga systems to create breathtaking images of Mandelbrot Sets
and Julia Sets in up to 256 colors. Most Amiga owners have seen or used
one of the many popular public domain programs for generating Mandelbrot
Set images. Until the advent of HAMandel these images were restricted to
the usual limited number of 16 or 32 Amiga colors. Those who've had an
interest in fractal art have seen some of the beautiful published work in
Scientific American (August, 1985) and The Beauty of Fractals (by Peitgen
and Richter - Springer Verlag) and hungered for a fractal art program on
the Amiga which can compute these images in hundreds of color shades.
HAMandel's release is also timely in that its HAM images can now be used
as 'clip art' with the new generation of HAM paint packages, such as
Digi-Paint and Photon Paint. By combining the results of your work with
HAMandel and the 'brush-wrapping' feature of Photon Paint you can create
highly artistic renditions of fractal images 'wrapped' around spheres and
other shapes.
The HAMandel images are rendered in a standard HAM (Hold And Modify) graphics
mode on the Amiga using 6 bit-planes. HAMandel always uses the maximum
graphical resolution of HAM, that is 320x400 pixels (interlaced screen).
HAMandel is a full-featured, multi-tasking, Intuition-based program. It has
the familiar Amiga user-interaction standard including:
Four pull-down Menus with Keyboard alternatives
Select Mandelbrot or Julia Sets and HAM shading control
Save and Load images as IFF files (with coordinates)
Iterations per point of 15, 31, 63, 127, 255, 511, or 1023
ZOOM by 2x, 4x, 8x, or 16x - Reset and Default X,Y and ColorCycle
DRAW, PAUSE and toggle the title bar on/off
HAM 320x400 Interlace screen for maximum detail up to 256 colors
Auxiliary window on the WorkBench screen shows the X,Y values and
current file path name
ZOOM-IN windows have a 'CANCEL' gadget (marked with a !) in
case you change your mind and wish to select a different ZOOM
Program operation from CLI or WorkBench Icon
CLI control allows pre-selection of X and Y coordinates as
well as Width so you can directly 'dive' into interesting
parts of the Mandelbrot Set or you can begin with the usual
full Mandelbrot Set 'default' settings.
WorkBench ICON control automatically loads an image of the full
Mandelbrot Set at the 'default' settings.
Full Amiga Multi-tasking. The program will exit if a low memory
condition occurs. Its designed with error-checking and crash-
resistance in mind!
All hand-crafted in 68000 Assembly Language using the techniques
described in Compute!'s AMIGA MACHINE LANGUAGE PROGRAMMING GUIDE,
which was also written by Dr. Wolf (with Doug Leavitt, the creator
of the ASM68010 speedy assembler for the Amiga).
Intuitive ease of use. Zooming only requires you 'PAUSE' the drawing
and move a ZOOM window's drag bar until the window is over the
area you want to ZOOM. Then just click the 'close' gadget on
the ZOOM window and select DRAW on a menu.
Coordinates are displayed at all times so you can make records of your
fractal explorations. Coordinates saved as text files.
Julia Sets aren't available on most Amiga Mandelbrot programs. They
are very beautiful and you can easily switch back and forth
between Mandelbrot and Julia Sets with HAMandel.
Compatibility with ALL AMIGA SYSTEMS with at least 512K memory. No
expansion memory is required, but HAMandel will work just fine
with expansion memory systems. It will use expansion memory
whenever possible to minimize its impact on limited CHIP memory
resources.
FAST. That means the arithmetic does not use Floating Point routines,
which can be slow on some Amigas. The fixed-point arithmetic
in HAMandel is about twice as fast as floating point with only
a slight sacrifice of accuracy. That means nice pictures in
from 2 minutes to an hour or so instead of overnight waits with
other programs. The techniques for fixed-point arithmetic were
taught to Dr. Wolf by Mark Riley, another fractal art enthusiast,
who developed them after being introduced to the Mandelbrot
Set by Dr. Wolf. Mr. Riley is well known in the Amiga music
community for his sophisticated SONIX program as well as his
contributions to AX Magazine.
HAMandel draws the full Mandelbrot Set with 63 iterations per point
in: (default settings X=-2.25, Y=-1.5, Width=3.0)
105 seconds on Amiga 1000 with Hurricane 68020 14MHz Board
371 seconds on Amiga 2000 with no accelerator board
With 255 iterations per point, the times are:
273 seconds on Amiga 1000 with Hurricane 68020 14MHz Board
***** USING HAMandel
You can start HAMandel two ways:
DoubleClick the WorkBench Icon or
Type HAMandel (return) in a CLI
Whichever way you start, HAMandel always begins using 255 iterations per point
(IPP) for up to 256 colors in the image. Once the program is running, you
can PAUSE and set IPP differently if you wish.
***** WORKBENCH STARTUP
When HAMandel is started from the WorkBench it automatically attempts
to load in an IFF image of the full Mandelbrot Set (X=-2.25, Y=-1.5,
Width=3.0, 255 IPP - up to 256 colors). The 'default' image is stored on
the HAMandel disk in the Pics directory. Its full path name is:
HAMandel:Pics/Pic0
If HAMandel finds an image with this file name, it loads it and displays
it on the main HAM screen. If this image can't be found, HAMandel sets
itself to the default values (X,Y,W, and IPP) noted above and PAUSEs with
a blank screen. The coordinate values for the initial image are also loaded
at the same time, from a file named:
HAMandel:Pics/Pic0.XYW
If HAMandel successfully loads the Pic0 and Pic0.XYW files when it starts
up, it goes directly into PAUSE mode. You can then begin your ZOOM-in
explorations of the Mandelbrot Set. (You may find it interesting to look
at an .XYW file using the CLI 'Type' command.)
***** CLI STARTUP
You can exercise a good deal of control using the CLI. Here are some
examples:
CLI COMMAND RESULTS
HAMandel ? Shows usage format and example, then quits
HAMandel Same as WB startup (loads Pic0 file and PAUSEs)
HAMandel -2.25,-1.5 Uses X,Y (width=3.0, 255 IPP), begins drawing
HAMandel -.8633,.2716,.00046 Uses X,Y,W (255 IPP), begins drawing
HAMandel -2.25 Shows usage format and example, then quits
HAMandel f Hamandel:pics/pic3 Starts using designated image file and coords.
HAMandel F df1:pics/pic2 Starts using designated image file and coords.
HAMandel df1:pics/pic1 Shows usage formate and examples, then quits
When you start HAMandel from the CLI you can simply use the default
starting picture, or either 2 or 3 parameters which control the X,Y
starting point (lower left corner of the screen) and 'width'. We always
recommend using all 3 parameters. If you use only 1, then HAMandel senses
an error (you must give both X and Y values if you want to select a starting
point). If you use only 2, HAMandel automatically selects 3.0 as the width
value. If you use all 3, you have the most control; its like 'pre-zooming'
on a region. This can be a time-saver if you're doing lots of Mandelbrot
exploring. In summary, from the CLI you can just type HAMandel to start up
with the usual starting pic loaded from disk or you can type HAMandel plus
some coordinate information to begin drawing at whatever point you wish.
Your other alternative is to use the 'f' or 'F' parameter followed by a
space and a file name (remember that a corresponding .XYW file will also
be loaded for the X, Y, and W values). The 'f' parameters let you start
HAMandel with any image file as the starting point for your zoom and color
explorations.
LIMITATION: Don't try to use more than 4 or 5 digits to specify a
floating point value. The software can handle up to 8
significant digits on input, but you'll get bad results
if you use a width value less than about .00002 . That
value represents a magnification of 75,000 in linear
dimension or about five billion in the square dimensions.
When HAMandel draws with Default Settings the program begins drawing the full
Set as quickly as possible. It may take a few seconds before it is obvious
that anything is happening, since the dark colors at the edges of this image
are pretty low contrast to the black background chosen for aesthetic reasons.
During the drawing with Defaults, the full Mandelbrot set is drawn simul-
taneously from the top and bottom of the screen. All other drawings of the
Mandelbrot and Julia sets take place only from bottom to top. The special
situation in the Default mode is that the Mandelbrot Set is symmetric at
the center (which is the center of the screen in this case), so HAMandel
is smart enough to recognize that and cut the drawing time in half by drawing
the top and bottom simultaneously.
***** DRAW MODE AND PAUSE MODE - TITLE BAR MESSAGES
HAMandel has two main modes of operation. In DRAW mode, it is busy
computing and drawing your image. In PAUSE mode, it is ready for user
interaction with the menus.
DRAW MODE - When in DRAW mode, most of the menus are 'ghosted' so you can't
use them. Only PAUSE and NOBAR options can be selected in DRAW
mode. DRAW mode also is obviously detectable from the message on
the title/menu bar. The DRAW mode 'message' says:
Drawing Mandelbrot - PAUSE to stop or
Drawing Julia - PAUSE to stop
PAUSE MODE - When in PAUSE mode, all of the menus options are available
(except PAUSE itself, which is 'ghosted'). All the usual
menu option selection is done during PAUSE mode. PAUSE mode
is also obviously detectable from the message on the title/menu
bar. The PAUSE mode 'message' says:
HAMandel stopped - DRAW to restart
PAUSE mode is also automatically engaged when the drawing is
finished (drawing reaches the top of the screen). When drawing
is finished, PAUSE mode is engaged and the program presents its
title 'message' on the menu/title bar:
HAMandel v1.0 ©1988 by Daniel Wolf
***** HAMANDEL'S EXTRA WINDOW
In addition to the main HAM screen you immediately see when HAMandel
starts, there is another AUXILIARY WINDOW on the Workbench Screen. To see
it, pull the HAM screen down in the usual way with the mouse by grabbing its
title bar. The little window on the Workbench screen shows the coordinates
of the current image and a file name (you can modify this string gadget to
supply file path names of your own for loading and saving images, see below).
***** CONTROLLING HAMandel - THE FOUR MENUS
Once HAMandel is under way, you'll be able to interact through the four
pull-down menus. If HAMandel is in its DRAW mode, the first thing you MUST
do to interact with the menus is to get the drawing to PAUSE.
Even while HAMandel is drawing, you can examine the menus:
Press the mouse menu button and bring the mouse pointer up to the title
bar - then you'll see the menus.
IMPORTANT While in DRAW mode, HAMandel checks to see if you make
a menu selection at the end of each line it is drawing
(when the drawing process reaches the right hand edge of the
screen). If HAMandel is busily involved in DRAW mode, it may
appear that it doesn't respond to your request for PAUSE mode
(see immediately below) for a few seconds. Be patient. If you
select PAUSE on the CONTROL MENU (while in DRAW mode) it may
take a few seconds to respond.
Control of PAUSE mode and DRAW mode is important, so lets look at the last
menu first.
***** CONTROL MENU - DRAW, PAUSE, NOBAR (far right on the menu bar)
DRAW (RIGHT AMIGA - D) You should see a checkmark next to the DRAW
option in the CONTROL menu. That means HAMandel is in DRAW mode (it should
be obvious). While HAMandel is drawing, the DRAW menu item is 'ghosted'
(you can't select DRAW while HAMandel is already in that mode). Note also
that when HAMandel is drawing, the other three menus are all totally ghosted.
You can't do anything with the menus until you get HAMandel to PAUSE!
PAUSE (RIGHT AMIGA - P) This menu item is not ghosted. Whenever HAMandel
is drawing, you can select this menu item to get it to PAUSE. Once you have
HAMandel in the PAUSE mode, then PAUSE will become ghosted and DRAW will become
available. Its natural. When drawing you can PAUSE, when paused you can
restart the DRAW mode. Once you have made HAMandel PAUSE, all the other menus
become un-ghosted so you can control all of the features of HAMandel when you
are in the PAUSE mode.
IMPORTANT Be sure you know how to work with the PAUSE and DRAW items
in the CONTROL menu before you go on.
NOBAR (RIGHT AMIGA - N) This menu item is never ghosted. If you select
it once, the menu/title bar at the top of the screen will disappear as soon
as possible. When you select this item again the menu/title bar will reappear
as soon as possible. You can 'toggle' the menu/title bar using this option
at any time. If you want to 'pull the screen down' or use the screen's
front/back gadgets you need to have the menu/title bar showing. If you just
want to see the maximum fractal image, you can use this option to 'hide' the
bar.
***** PROJECT MENU - MANDELBROT, JULIA, SHADE RED, SHADE GRN, SHADE BLU,
SAVE, LOAD, QUIT
NOTE - This menu is completely ghosted during DRAW mode. To use it
you must select the PAUSE mode.
Once you have learned to switch HAMandel to the PAUSE mode there are a
variety of options on this menu which give you a lot of flexible control of
HAMandel's fractal drawing and HAM coloring shades.
JULIA/FATOU (RIGHT AMIGA - J) When in the PAUSE mode you can select the
Julia Set and then restart the program by selecting DRAW. HAMandel will
create the Julia/Fatou Set corresponding to the coordinates of the lower-left
corner of the screen. Usually J/F Sets are fast to calculate and they are
always symmetric. They are also quite interesting. When you are in an
interesting region of the Mandelbrot Set, PAUSE and select JULIA/FATOU and
restart the DRAW mode. The resulting J/F set usually 'looks like' the same
region in the Mandelbrot Set, but with a beautiful symmetry. HAMandel always
draws 'full' Julia/Fatou Sets, that is, you can't ZOOM in on the Julia Sets.
There is one Julia/Fatou Set for each possible lower-left hand corner point
in the Mandelbrot Set. Its as if each point in the Mandelbrot Set has a
complete two dimension picture hidden within that one point, that is the
Julia Set for that point. If the lower left corner point on a Mandelbrot
picture is 'inside' the Mandelbrot Set (in a large 'black' area) then the
Julia Set will look a certain way. If the point is 'outside' the Mandelbrot
Set, the Julia Set will look different. The best points to use for Julia Sets
are those in which you are 'close' to the edge of the Mandelbrot Set.
To most effectifely utilize this menu option, first get yourself to a nice area
in the Mandelbrot set, then PAUSE, select JULIA/FATOU and restart DRAW.
When the Julia Set is complete you can return to this menu and de-select
this item, then restart DRAW. HAMandel will re-draw the Mandelbrot Set
exactly where you left off to explore the Julia Set. There is no change of
coordinates when you switch between Mandelbrot and Julia Sets. The Julia Sets
let you look at the '3rd and 4th dimensions' of the Mandelbrot Set with a
minimum of fuss or interruption.
SHADE RED (RIGHT AMIGA - R) Selecting this option during PAUSE mode
will immediately shift the HAM drawing algorithm from its current state
(default is SHADE BLU - see below) to a RED shading mode. The dominant
colors for this mode are shades of GREEN, with the minor shades in RED.
SHADE GRN (RIGHT AMIGA - G) Selecting this option during PAUSE mode
will imediately shift the HAM drawing algorithm from its current state to
a GREEN shading mode. The dominant colors for this mode are shades of BLUE,
with the minor shades in GREEN.
SHADE BLU (RIGHT AMIGA - B) Selecting this option during PAUSE mode
will imediately shift the HAM drawing algorithm from its current state to
a BLUE shading mode. The dominant colors for this mode are shades of RED and
YELLOW with minor shades in BLUE. This is the default setting and when
HAMandel begins you can see a checkmark next to this 'active' option.
LOAD (RIGHT AMIGA - L) Selecting this option during PAUSE mode will
save the current picture according to the file path name shown in the PATH
string gadget of the auxiliary Workbench screen window (see above, HAMandel's
Extra Window)
SAVE (RIGHT AMIGA - S) Selecting this option during PAUSE mode will
load a previously saved image according to the file path name shown in the
PATH string gadget of the auxiliary Workbench screen window (see above,
HAMandel's Extra Window)
QUIT (RIGHT AMIGA - Q) Selecting this option during PAUSE mode will
exit the program!
***** DEPTH MENU - 15, 31, 63, 127, 255, 511, 1023
NOTE - This menu is completely ghosted during DRAW mode. To use it
you must select the PAUSE mode.
This menu controls the number of iterations per point (IPP), which is
related both to the 'accuracy' and detail of the Mandelbrot Set image as
well as to the maximum number of colors used in drawing.
15 (RIGHT AMIGA - 4) During PAUSE mode you can select 15 IPP. This
can be a timesaver of you just need to quickly draw a portion of an image.
This is not recommended for high quality pictures, but is present as a
convenience only.
31 (RIGHT AMIGA - 5) During PAUSE mode you can select 31 IPP. This
can be a timesaver of you just need to quickly draw a portion of an image.
This is not recommended for high quality pictures, but is present as a
convenience only. It may work just fine for some Julia Set images.
63 (RIGHT AMIGA - 6) During PAUSE mode you can select 63 IPP. This
can be a timesaver of you just need to quickly draw a portion of an image.
An IPP of 63 is OK when drawing the full Mandelbrot Set.
127 (RIGHT AMIGA - 7) During PAUSE mode you can select 127 IPP. This
is a good setting for many Mandelbrot and Julia images and will give you
up to 128 colors. RECOMMENDED SETTING FOR MEDIUM ZOOM MANDELBROT SETS AND
MOST JULIA SETS.
255 (RIGHT AMIGA - 8) During PAUSE mode you can select 255 IPP. This is
the maximum available for HAMandel and its use gives you the most beautiful
images possible with HAMandel with up to 256 colors. You should use this
IPP setting whenever you are working with significant magnifications since
there is a curious relationship between the size of a Mandelbrot Set region
and the number of colors you're likely to see. The smaller the region, the
better off you'll be with this setting. The drawback is that 255 IPP is the
slowest possible drawing speed. You'll see that effect if you (foolishly)
include large sections of the 'black' areas (that is, areas that are really
'inside' the Mandelbrot Set - they are pretty uninteresting since they're
all black). When you've selected a region for ZOOMing that is near the
'border' of the Mandelbrot Set, you'll get the best results with this setting.
Using an IPP setting of 255 lets HAMandel really shine; the extra time is
usually worth the wait because the beauty of the finished images can be
breathtaking. There is a neat relationship between maximum colors and maximum
detail in the picture. HIGHLY RECOMMENDED FOR THE MOST BEAUTIFUL IMAGES.
This is the default value when HAMandel starts, note the checkmark on the
menu.
511 (RIGHT AMIGA - 9) During PAUSE mode you can select 511 IPP. This
is a good setting for many Mandelbrot and will give you up to 256
colors. RECOMMENDED SETTING FOR HIGH ZOOM MANDELBROT SETS.
1023 (RIGHT AMIGA - A) During PAUSE mode you can select 1023 IPP. This
is a good setting for many Mandelbrot images and will give you up to 256
colors. RECOMMENDED SETTING FOR HIGH ZOOM MANDELBROT SETS.
***** OPTIONS MENU - ZOOM 2X, 4X, 8X, 16X, COLOROLL, DEFAULT XY, RESET XY
NOTE - This menu is completely ghosted during DRAW mode. To use it
you must select the PAUSE mode. ZOOM is restricted to Mandelbrot Set
images. You cannot ZOOM in on Julia Sets (perhaps in a future version of
HAMandel).
The OPTIONS menu gives you control of ZOOMing, color cycling, and 'resetting'
the coordinates (so you don't have to exit the program to re-start drawing
an image from a blank screen).
ZOOM 2X (RIGHT AMIGA - 0)
ZOOM 4X (RIGHT AMIGA - 1)
ZOOM 8X (RIGHT AMIGA - 2)
ZOOM 16X (RIGHT AMIGA - 3) Zooming is what makes the Mandelbrot set
interesting. The Mandelbrot Set can be enlarged INDEFINITELY and will
always continue to show interesting detail. Mathematicians have concluded
that this is one feature which helps make it the most complex mathematical
object known (July 1988). Zooming with HAMandel is fast and easy. HAMandel
is limited to magnifications of about 50-75,000 in order to get the math of
the fractal shape evaluation to match the 256 color mode use on the HAM screen.
If you attempt a ZOOM which would result in a Width value too small for the
math to handle, the ZOOM window will quickly close itself. Try ZOOMing with
one of the smaller ZOOM values. If none of the ZOOM windows works, its because
no further ZOOM is possible.
Select the ZOOM value you wish while you've got HAMandel in PAUSE mode.
A special ZOOM window will appear on top of the HAM image on the screen. You
can do this even when the picture is only partly completed. HAMandel knows
where you are on the screen even if part of the screen is still blank. Just
move the ZOOM window around on the screen until it covers the area you wish to
enlarge. Then simply click on the 'close window' gadget of the ZOOM window
and restart the DRAW mode. HAMandel will automatically calculate the new
coordinate of the lower left corner (wherever you left the lower left corner
of the ZOOM window) and begin drawing your ZOOMed Mandelbrot Image.
The ZOOM windows overlay a HAM screen and can cause a rather strange
appearance with massive streaks of color extending from the ZOOM window's
right edge to the right edge of the screen. DON'T WORRY. When you close the
ZOOM window (or click its ! CANCEL gadget) the screen will be restored OK.
IMPORTANT - ESCAPING FROM A ZOOM WINDOW WITHOUT CAUSING ANY EFFECTS AT ALL
You may find that you really want a different ZOOM factor after the
ZOOM window is already on the screen. Or even that you don't want to ZOOM
after all. You can 'exit' from the ZOOM window by clicking on the ! gadget
instead of the 'close window' gadget. Then if you restart the DRAW mode,
HAMandel will simply continue where it left off. If you click on the ! gadget
its as if you never even asked for a ZOOM. You can immediately select a
different ZOOM.
VERY IMPORTANT - ZOOM ONLY WORKS ONCE DURING PAUSE MODE
Once you do select a ZOOM window, position it, and click its 'close window'
gadget you are committed. You can't select ZOOM again until you restart DRAW
and then PAUSE again. It would be quite bizarre if this were not true. At
this time, the menu doesn't 'ghost', but the program internally forbids you
from re-selecting another ZOOM until its reasonable to do so. Were this not
true, you might be in the position of ZOOMing 'blind'.
ALSO IMPORTANT - LIMITED DRAG BAR SIZE ON ZOOM 16X WINDOW
When you select the smaller ZOOM windows (ZOOM 8X or ZOOM 16X) the
window is so small that the whole title of the window, NEWXY, may not
be completely visible. The ZOOM 16X window is so small that there is only
a very small portion of drag bar available next to the 'close window' gadget.
BE CAREFUL when moving the ZOOM 16X window; be sure to position your mouse
pointer in the drag bar area so you don't hit the 'close window' gadget
inadvertently and freeze in a zoom you don't want.
COLOROLL (RIGHT AMIGA - C) During PAUSE mode you can request a color
cycling mode. This can be very beautiful with finished images (its a little
strange with partially completed images to see a large portion of blank screen
cycling its color). The color cycling is limited to about 10 seconds, after
which the colors are restored to their starting points and you're back where
you started. If you wish to extend the duration of the coloroll, simply
move the mouse pointer to the far left edge of the screen during the coloroll.
As long as you leave the mouse pointer at the far left edge, the coloroll will
continue. To get it to stop, just move the mouse pointer away from the left
edge and it will halt in a few seconds.
DEFAULT XY (RIGHT AMIGA - Z) During PAUSE mode you can select this option
which forces HAMandel to 'start over from the beginning'. It will force the
program to draw the full Mandelbrot Set from the beginning, just as if you
exited the program and restarted it using HAMandel or from the WorkBench.
This can prevent you from having to exit the program and re-start it if you
get lost somewhere in the complex plane. If you simply set the name
HAMandel:pics/pic0 in the PATH string gadget of the auxiliary window and then
PAUSE to LOAD, you'll get the same picture. This menu item is for convenience
and completeness only.
RESET XY (RIGHT AMIGA - Y) During PAUSE mode you can select this option to
assure that the screen is cleared when you reactivate DRAW. This is very
useful. For example, say you PAUSE and change the IPP setting, then restart
DRAW. Your resulting image will have portions with two different IPP settings.
The same reasoning applies to PAUSEing to change SHADES (RED, GRN, or BLU).
DRAW is pretty smart. It knows how to continue just where you left off.
If you select this option then DRAW will start the whole screen over with
your new IPP or COLOR setting.
IMPORTANT For best results, after you PAUSE to change IPP (DEPTH MENU) or
SHADE colors, it is WISE to select RESET XY before you reactivate
DRAW.
This completes the presentation of HAMandel menu operation.
MORE ABOUT THE AUXILIARY WINDOW
The small window on the Workbench screen contains 4 string gadgets.
Three of them show the X, Y, and W(idth) numbers in ASCII Decimal. The
other shows the current File Path Name used for LOAD and SAVE operations.
You can alter the PATH name string gadget to set up LOAD and SAVE for your
own file naming requirements. Remember the HAMandel disk has Pic0, Pic1,
etc. in its PICS directory so you can use them as starting points for your
Mandelbrot Set explorations, too. WE RECOMMEND LEAVING THE X, Y, AND W
STRING GADGETS ALONE. THESE THREE STRING GADGETS MAY BE EXPLOITED IN FUTURE
RELEASES OF HAMandel.
MORE ABOUT LOADING AND SAVING IMAGES - THE .XYW COORDINATE FILES
For each image you LOAD or SAVE, there is a small extra file, called the
.XYW file, which contains the X, Y, and W values for that image. The
extra .XYW file is a short ASCII text file. For example, the initial
default image file is HAMandel/Pics/Pic0. That file has the actual IFF
image file. There is another file called HAMandel/Pics/Pic0.XYW which has
the X, Y, and W values. HAMandel always saves the .XYW file during a SAVE
operation and always tries to find the .XYW file during a LOAD operation.
Try doing a SAVE operation (during PAUSE mode) with a file name of your
own choice. Then examine (using the CLI) the directory in which you saved
the image. You should find the file name and also an identical one with
the .XYW extension tacked on. The .XYW file is 34 bytes long.
In summary, SAVE and LOAD always work with two files. First is the actual
IFF image file with its name in the PATH string gadget of the auxiliary window.
Second is the coordinate file which has the same name as the image file, but
with the .XYW extension. Whenever you do a SAVE, both files are saved.
Whenever you do a LOAD, both files are loaded.
NOTE - HAM SCREEN LIMITATIONS - MENU OPERATION AND POSSIBLE DAMAGE TO THE IMAGE
When HAMandel is drawing the full Mandelbrot Set (from both top
and bottom of the screen), activation of menus using the mouse and pointer
may cause some damage to the image. This only occurs when the drawing
process is actually drawing through the area where a menu strip is showing
at the same time. You can avoid this damage easily; just wait a few seconds
during the drawing until it proceeds part way 'down' the screen past the
bottom edge of the menu strips. You can always prevent any damage by just
using the Keyboard Alternative commands shown for each menu option.
When you activate menus, they project down the screen in the HAM area
and appear to cause massive streaks. Don't worry, those streaks only appear
when the menu is actually being used. They will vanish when you release the
mouse menu button and won't damage your image.
The menu/title bar itself (for reasons not yet well understood) is always
damaging to the very top few lines of the image. Intuition's way of handling
the title bar on a HAM screen apparently prevents those few lines of the screen
from behaving exactly like the remainder of the screen. You will note (even
with NOBAR active) that the top few lines of the screen have a different
appearance than the rest of the screen. MegageM is working to provide a way
of preventing this in a future release of HAMandel. Dr. Wolf wished to avoid
the need to move to another screen to control the menus. You only need to
get to the WorkBench screen to change the file PATH name using its string
gadget in the Auxiliary Window.
The HAM graphics mode on the Amiga has some limitations built-in. It is
not possible to have arbitrary colors immediately next to one another in
adjacent pixels under most circumstances. Programmers and HAM paint package
users are aware of this limitation which can sometimes cause streaks of a few
pixels length (horizontal lines). HAMandel uses special techniques to avoid
these built-in limitations as much as possible. Each SHADE option (SHADE RED,
SHADE GRN, and SHADE BLU) has its own color palette of 16 colors which have
been very carefully chosen to avoid streaking. We don't recommend you change
them, but you may be able to improve your pictures and even eliminate a few
streaks (when they do occur) by using a color palette program on your finished
image. Dr. Wolf has had some success with ANYTIME from DISCOVERY SOFTWARE.
This color palette program lets you alter any of the 16 palette colors while
viewing the results directly on the image. It won't always give good results
and Dr. Wolf recommends you take care when changing palette colors. Always
do your palette color changing AFTER the image is complete and you have
saved it to disk. Then load it into a HAM paint program to modify it to
your heart's desire. Another color modifying program is COLOURS on one of
the Fred Fish disks.
***** What IS the Mandelbrot Set, Anyway?
To really get a handle on the Mandelbrot set, you should first know a few
facts:
1. Benoit Mandelbrot is a mathematician who works for IBM. He
discovered the Mandelbrot Set in 1980.
2. The Mandelbrot Set exists in a region of the 'complex plane'
(where distance in the y direction is multiplied by i [the
square root of -1]) centered around the 0,0 point. The 'whole
thing' lies between -2.25 and +0.75 on the x (real) axis and
between -1.5 and +1.5 on the y (imaginary) axis. You can draw
a little x,y coordinate grid and then draw a box using those
coordinates to get an idea of 'where the Mandelbrot Set lives'.
3. To make an image of the Mandelbrot Set, you set up a screen layout
of, say, 320x400 pixels and let the leftmost border pixels correspond
to x = -2.25 (and rightmost border pixels are set to x = +0.75).
Then each pixel along a horizontal line on the screen has a certain
x value. For the y direction, set the bottommost line of pixels
to a y value of -1.5 (and topmost line to y = +1.5). Now each
horizontal line of pixels on the screen layout has a different y
value. Each pixel combination on the screen has a unique x,y
position on the coordinate grid.
The x value of the 14th pixel from the left is:
-2.25 + 14 * (3/320)
The y value of the 139th pixel from the bottom is:
-1.5 + 139 * (3/400)
If our left and bottom borders moved elsewhere in the coordinate
grid, these formulas would change accordingly.
In general, the x value of the nth pixel in a row is:
x val. of leftmost border + n * (width of grid/screenwidth)
and the y value of the nth pixel from the bottom is:
y val. of bottommost border + n * (height of grid/screenheight)
Now, we need to make a test for each pixel and give the pixel a
color depending on the results of the test. The 'test' tells
whether that point in the coordinate grid is 'in' the Mandelbrot
Set.
The Test
Each pixel has a certain x and y value (x is somewhere between
-2.25 and +.75, while y is between -1.5 and +1.5) which we must
use in the test. In the Mandelbrot Set Test, these numbers are
treated mathematically as if they were 'complex' numbers. A
complex number has a REAL part and an IMAGINARY part. In our
test, the x value is the REAL and the y value is the IMAGINARY.
Now here is the heart of the test:
Take the x,y values of the point and create a new
x,y combination in the following way:
new x = x^2 - y^2 + x(point)
new y = 2xy + y(point)
Each time new x and new y are created, they replace
the pre-existing x and y but NOT the x(point) and y(point)
which remain as constant for each pixel.
Also find the 'size' of the new combination in the
following way:
size = new x^2 + new y^2
Now check if size is > 4 (same thing as checking if
square root of size is > 2).
For those who understand complex numbers, we start
with z = x + iy and we get new z = z^2 + z(point).
The size of new z is z^2.
That accomplishes the test.
The test checks to see if, when you change x and y into newx and newy,
the size of the combination of newx and newy is larger than 4. If
it is, then if you then make new new x and new new y the size will
certainly only grow larger. What we are looking for is how many
time we can make a new x and a new y (starting with x and y from the
coordinate grid points for a pixel on the screen) without letting the
'size' of the result blast off to infinity.
Every pixel on the screen has a number associated with it. That
number says how many times you can do the test before the 'size'
gets bigger than 4. From that number we can give the pixel a color.
Usually a Mandelbrot Set program not only relates the screen's
grid of pixels into x,y values for the test, but also sets a limit
on how many times the test will be done before quitting. A point
on the coordinate grid is 'in' the Mandelbrot Set if you can do the
test an infinite number of times. We, however, are mortal and cannot
afford to check even a 320x400 array of pixels more than about 1000
times each to get a picture in some reasonable time.
HAMandel's grid is 320x400 (128,000 pixels) with a maximum 'limit'
of 1023 tests per pixel (iterations per point). If a point 'survives'
the test up to the 'limit' (depth value) then we simply assume that
point is 'in' the Mandelbrot Set and assign it a black color.
Once the cycle of tests and size checking is done up to a 'limit'
number of times for each pixel, then each pixel should have a color
related to the number of times it 'survied' the test and the entire
screen of colored pixels IS the image of the Mandelbrot Set for the
selected region of the coordinate grid representing the 'complex'
plane.
4. For every point in the Mandelbrot Set there is a corresponding
Julia Set. The formula is almost identical, but a single x(point)
and y(point) are used throught the scan through all pixels. The
entire grid is scanned like the Mandelbrot Set, but instead of
changing x(point) and y(point) with each new pixels x and y values,
the x(point) and y(point) are pre-chosen and fixed throughout the
entire screen of pixels. That is, for each point in the Mandelbrot
Set you can set x(point) and y(point) constant and scan through all
the pixels to arrive at the image of the Julia Set for x(point) and
y(point) - so long as you scan over a grid from about -3 to 3 (REAL)
and -3 to 3 (IMAGINARY).
5. If you wish to read some great books on the Mandlebrot Set and other
fractals, try:
The Fractal Geometry of Nature by B. Mandelbrot (Freeman)
The Beauty of Fractals by O. Peitgen (Springer)
The Science of Fractal Images by O. Peitgen (Springer)
The last one has numerous algorithm descriptions in pseudocode for
ambitious programmers.
6. Fractal means FRACTionAL Dimension. Fractals are oddballs of
geometry. We think of lines as one-dimensional, planes as two-
dimensional, and solids as three-dimensional. Fractals occupy
the 'spaces' between these whole numbers of dimensions. A highly
complicated folded line could begin to look as if it 'fills up'
a sheet of paper (a plane). Then the line sort of is between 1
and 2 dimensions. A coastline of an island has the property that
its length depends on how 'finely' you measure it. These two kinds
of lines are fractals. The first book (above) really goes into
this definition and how you can estimate the actual fractional
dimension of a fractal.